package com.bdqn.controller;

import com.alibaba.fastjson2.JSON;
import com.bdqn.pojo.SysRole;
import com.bdqn.service.SysRoleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * SysRoleController
 *
 * @author LILIBO
 * @since 2024/8/8
 */
@Controller
@RequestMapping("/role")
public class SysRoleController {

    @Resource
    private SysRoleService sysRoleService;

    /**
     * Ajax获取角色列表
     *
     * @return
     */
    @ResponseBody
    @GetMapping("/ajaxList")
    public String ajaxList() {
        List<SysRole> list = sysRoleService.list();
        return JSON.toJSONString(list);
    }

}
